Create a Form Method (Sub or Function)
Methods defined in an InteropForm can be exposed to Visual Basic 6.0. To do so, decorate the custom method with the InteropFormMethod attribute. Methods may be subroutines (Sub) or functions (Function) that return values.
Public Sub ReverseBackgroundColors()
Dim lblOldBackColor As
Color = Me.lblHelloText.BackColor
lblHelloText.BackColor =
Me.BackColor
Me.BackColor =
lblOldBackColor
End Sub
To quickly define a method use the InteropSub or InteropFunc snippets installed with the toolkit: Simply type interopsub+Tab or interopfunc+Tab and complete the method signature.
Only certain Types may be used as return values or parameters. See Type Restrictions for details.